package com.cyl.XmlDemo.entity;

import java.util.Iterator;
import java.util.Vector;

public class RoomInfo {
	
	//房间类型 video audio chat
	private String type;
	//房间名字
	private String name;
	//用户名列表
	private Vector<String> user = new Vector<String>();
	
	public RoomInfo(String type, String name,String username) {
		super();
		this.type = type;
		this.name = name;
		this.user.add(username);
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public void addUser(String username){
		user.add(username);
	}
	
	public void removeUser(String username){
		user.remove(username);
	}
	
	/**
	 * 排除当前用户的房间人数
	 * @return
	 */
	public int getSize(){
		return user.size() - 1;
	}

	public boolean containUser(String uid){
		return user.contains(uid);
	}
	
	public Iterator<String> getIterator(){
		return user.iterator();
	}
}
